package com.mangowang.module.main.adapter;

import android.content.Context;
import android.graphics.Color;
import android.widget.ProgressBar;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.mangowang.module.main.R;
import com.mangowang.module.main.bean.AccountOneBean;

import org.jetbrains.annotations.NotNull;

import java.util.List;

public class AccountOneAdapter extends BaseQuickAdapter<AccountOneBean, BaseViewHolder> {
    public AccountOneAdapter(Context context, List<AccountOneBean> dataList) {
        super(R.layout.account_one_item, dataList);
    }


    @Override
    protected void convert(@NotNull BaseViewHolder baseViewHolder, AccountOneBean bean) {
        baseViewHolder.setText(R.id.tv_month,bean.getMonth());
        ProgressBar progressBar =  baseViewHolder.getView(R.id.progress);
        progressBar.setProgress(bean.getProgressOne());
        progressBar.setSecondaryProgress(bean.getProgressTwo());
        if (bean.isSelect())
        {
            baseViewHolder.setTextColor(R.id.tv_month, Color.parseColor("#FFFFFF"));
        }else
        {
            baseViewHolder.setTextColor(R.id.tv_month, Color.parseColor("#4DFFFFFF"));
        }

    }
}
